import request from '@/utils/request'

/**
 * 列表
 */
export const getTrain = (query) => {
    return request({
        url: '/train/',
        method: 'get',
        params: query
    })
}


/**
 * x新增
 */
export const addTrain = (data) => {
        return request({
            url: '/train/',
            method: 'post',
            data: data
        })
    }
    /**
     * 删除
     */
export const delTrain = (id) => {
    return request({
        url: '/train/' + id + '/',
        method: 'delete',
    })
}

/**
 * 详情
 * @param data
 */
export function trainDetail(id) {
    return request({
        url: '/train/' + id + '/',
        method: 'get'
    })
}
/**
 * 随堂测验
 * @param data
 */
export function getTrainTest(query) {
    return request({
        url: '/TrainTest/',
        method: 'get',
        params: query
    })
}
/**
 * 提交随堂测验
 * @param data
 */
export function postTrainTest(data) {
    return request({
        url: '/TrainTest/',
        method: 'post',
        data: data
    })
}